//
//  ProfileViewController.m
//  Bunoff
//
//  Created by Stephen Tran on 4/29/14.
//  Copyright (c) 2014 STEPHENTRAN. All rights reserved.
//

#import "ProfileViewController.h"
#import "AppDelegate.h"
@interface ProfileViewController ()

@end

@implementation ProfileViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
//    NSData * data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self.imageUrl]];
//    UIImage* image = [UIImage imageWithData:data];
    if(self.user != NULL)
    {
        NSURL *url = [NSURL URLWithString:self.user.profileImageFB];
        NSData *data = [NSData dataWithContentsOfURL:url];
        UIImage *img = [[UIImage alloc] initWithData:data];
    
        self.lblFullName.text = self.user.fullNameFB;
        self.lblEmail.text = self.user.emailFB;
        self.profileImage.image = img;
    }
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
    
    if ([segue.identifier isEqualToString:@"profileSegue"]) {
        
    }
    else if([segue.identifier isEqualToString:@"loginSegue"]){
        
        
    }
    else{
        //no segue to push
    }
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
